/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package proteoman.data;

import java.util.Set;
import java.util.HashSet;

/**
 *
 * @author gjj
 */
public class MassPeptideDataImpl extends PeptideDataImpl implements MassPeptideData {
    protected Set<Integer> modificationSites;
    protected String activationType;
    protected byte chargeState;
    protected char previousAA;
    protected char nextAA;
    protected double mhPlus;
    protected double deltaM;
    protected double ppm;
    protected int[] ions;
    protected double runningTime;
    protected Set<MassSpectrum> massSpectra;

    public MassPeptideDataImpl() {
        modificationSites = new HashSet<Integer>();
        massSpectra = new HashSet<MassSpectrum>();
    }

//    public String getAnnotatedSequence() {
//
//    }

    public Set<Integer> getModificationSites() {
        return modificationSites;
    }

    public String getActivationType() {
        return activationType;
    }

    public double getRunningTime() {
        return runningTime;
    }

    public byte getChargeState() {
        return chargeState;
    }

    public char getPreviousAA() {
        return previousAA;
    }

    public char getNextAA() {
        return nextAA;
    }

    public double getMHPlus() {
        return mhPlus;
    }

    public double getDeltaM() {
        return deltaM;
    }

    public double getPPM() {
        return ppm;
    }

    public int[] getIons() {
        return ions;
    }

    public Set<MassSpectrum> getMassSpectra() {
        return massSpectra;
    }

    public void addModificationSite(final int site) {
        if (site<0 || site>=sequence.length()) {
            throw new java.lang.IndexOutOfBoundsException("Site cannot exceed the sequence.");
        }
        modificationSites.add(site);
    }

    public void setChargeState(final byte chargeState) {
        this.chargeState = chargeState;
    }

    public void setActivationType(final String type) {
        if (type==null) {
            throw new java.lang.NullPointerException();
        }
        this.activationType = type;
    }

    public void setRunningTime(double minutes) {
        this.runningTime = minutes;
    }

    public void setPreviousAA(final char aa) {
        this.previousAA = aa;
    }

    public void setNextAA(final char aa) {
        this.nextAA = aa;
    }

    public void setMHPlus(final double mhPlus) {
        this.mhPlus = mhPlus;
    }

    public void setDeltaM(final double deltaM) {
        this.deltaM = deltaM;
    }

    public void setPPM(final double ppm) {
        this.ppm = ppm;
    }

    public void setIons(final int[] ions) {
        this.ions = ions;
    }

    public void setIons(final int i1, final int i2) {
        ions = new int[2];
        ions[0] = i1;
        ions[1] = i2;
    }

    public void addMassSpectrum(final MassSpectrum ms) {
        if (ms==null) {
            throw new java.lang.NullPointerException();
        }

        massSpectra.add(ms);
    }

}
